//
//  RegisterView.m
//  UI_豆瓣
//
//  Created by dllo on 15/11/1.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "RegisterView.h"

@interface RegisterView ()

@property (nonatomic, retain) UILabel *nameLabel;
@property (nonatomic, retain) UILabel *passwordLabel;
@property (nonatomic, retain) UILabel *confirmPassword;
@property (nonatomic, retain) UILabel *telephoneNum;
@property (nonatomic, retain) UILabel *email;

@end

@implementation RegisterView


- (void)dealloc
{
    [_email release];
    [_teleNumFd release];
    [_confirmFd release];
    [_passwordFd release];
    [_nameFd release];
    [_nameLabel release];
    [_passwordLabel release];
    [_confirmPassword release];
    [_telephoneNum release];
    [_email release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creareSubView];
    }
    return self;
}

-(void)creareSubView
{
       //注册用户名
    self.nameLabel = [[UILabel alloc] initWithFrame: CGRectMake(50, 100, 80, 30)];
    self.nameLabel.text = @"用户名:";
    [self addSubview:self.nameLabel];
    [_nameLabel release];
    
    //注册密码
    self.passwordLabel = [[UILabel alloc] initWithFrame: CGRectMake(50, 150, 80, 30)];
    self.passwordLabel.text = @"密码:";
    [self addSubview:self.passwordLabel];
    [_passwordLabel release];
    
    //确认密码
    self.confirmPassword = [[UILabel alloc] initWithFrame: CGRectMake(50, 200, 80, 30)];
    self.confirmPassword.text = @"确认密码:";
    [self addSubview:self.confirmPassword];
    [_confirmPassword release];
    
    //手机号
    self.telephoneNum = [[UILabel alloc] initWithFrame: CGRectMake(50, 250, 80, 30)];
    self.telephoneNum.text = @"手机号:";
    [self addSubview:self.telephoneNum];
    [_telephoneNum release];
    
    
    //注册 邮箱号
    self.email = [[UILabel alloc] initWithFrame: CGRectMake(50, 300, 80, 30)];
    self.email.text = @"邮箱:";
    [self addSubview:self.email];
    [_email release];
    
    
    
    //请输入用户名
    self.nameFd = [[UITextField alloc] initWithFrame:CGRectMake(150, 100, 150, 30)];
    self.nameFd.borderStyle = 3;
    self.nameFd.placeholder = @"请输入用户名";
    [self addSubview:self.nameFd];
    [_nameFd release];
    self.nameFd.clearButtonMode = UITextFieldViewModeAlways;
    
    //输入密码
    self.passwordFd = [[UITextField alloc] initWithFrame:CGRectMake(150, 150, 150, 30)];
    self.passwordFd.borderStyle = 3;
    self.passwordFd.placeholder = @"请输入密码";
    self.passwordFd.secureTextEntry = YES;
    [self addSubview:self.passwordFd];
    [_passwordFd release];
    self.passwordFd.clearButtonMode = UITextFieldViewModeAlways;
    
    //输入密码 确认密码
    self.confirmFd = [[UITextField alloc] initWithFrame:CGRectMake(150, 200, 150, 30)];
    self.confirmFd.borderStyle = 3;
    self.confirmFd.placeholder = @"请再次输入密码";
    self.confirmFd.secureTextEntry = YES;
    [self addSubview:self.confirmFd];
    [_confirmFd release];
    self.confirmFd.clearButtonMode = UITextFieldViewModeAlways;
    
    //输入手机号
    self.teleNumFd = [[UITextField alloc] initWithFrame:CGRectMake(150, 250, 150, 30)];
    self.teleNumFd.borderStyle = 3;
    self.teleNumFd.placeholder = @"请输入手机号";
    [self addSubview:self.teleNumFd];
    self.teleNumFd.keyboardType = UIKeyboardTypePhonePad;
    [_teleNumFd release];
    self.teleNumFd.clearButtonMode = UITextFieldViewModeAlways;
    
    
    //输入邮箱
    self.emailFd = [[UITextField alloc] initWithFrame:CGRectMake(150, 300, 150, 30)];
    self.emailFd.borderStyle = 3;
    self.emailFd.placeholder = @"请输入邮箱";
    [self addSubview:self.emailFd];
    [_emailFd release];
    self.emailFd.clearButtonMode = UITextFieldViewModeAlways;
    
}


-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.nameFd resignFirstResponder];
    [self.passwordFd resignFirstResponder];
    [self.confirmFd resignFirstResponder];
    [self.teleNumFd resignFirstResponder];
    [self.emailFd resignFirstResponder];
    
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
